﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


public class Singleton<T> where T : class, new()
{
    private static T instance = null;

    protected static T Instance
    {
        get
        {
            if (instance == null)
            {
                instance = new T();
            }
            return instance;
        }
    }

    public Singleton()
    {
        Init();
    }

    protected virtual void Init() { }
}
